feat(reset-credits): add banked rate-limit reset credits#1053
Conversation
|
nice work on this — the ui and openspec coverage are way ahead of my overlapping pr (#1056). while implementing and testing the same feature against real upstream accounts, i ran into a few gaps that might be worth folding in here: 1. refresh usage after consume#1014 asks for an immediate 2. block paused / reauth / deactivated on consumethe scheduler correctly skips paused accounts for polling, but the dashboard still shows redeem on paused accounts and the consume endpoint doesn't check account status. i'd return 409 for paused, reauth_required, and deactivated before hitting upstream. 3. proxy-aware upstreamaccounts with per-account upstream routes need the codex transport path for credits fetch and consume, not only direct 4. visibility without extra polling
5. live fetch at consume timecache-first is fast but can go stale. fetching credits once at click time (then consume) is closer to what the desktop client does and avoids 409s when the cache lags behind upstream. 6. audita small happy to help with a follow-up pr on this branch for any of the above. planning to close my duplicate #1056 in favor of this one. |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 10f685b67c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 433b956ddd
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
|
Codex Review: Didn't find any major issues. Already looking forward to the next diff. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
when will this be added @Soju06 ? :) I want to be able to check bank reset and reset accounts via codex-lb |
|
+1 |
|
I am not converting to ready to merge as
Once these items are resolved, I will convert the status to "Ready to Merge" |
|
also tried, reset worked for me in 2 accounts |
|
@all-contributors please add @ellentane for code, test |
|
I've put up a pull request to add @ellentane! 🎉 |
|
@codex review |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4d5f43a6f7
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ed5f5de1f8
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: dd35115f6f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 67b0a32022
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
# Conflicts: # .all-contributorsrc # README.md
This reverts commit 6fd64f4.
eb2f907 to
bee8646
Compare
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bee86464df
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 48b9500115
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
cf6a3bb to
705a48d
Compare
|
@codex review |
|
Codex Review: Didn't find any major issues. What shall we delve into next? Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |




UPDATE: tested redeeming a reset credit, and it is a success, so I am updating it to
Ready to ReviewMay need a several pass of codex review to truly ready.
Summary
Adds banked rate-limit reset credit support across the backend and dashboard so operators can see per-account credit counts, expiry timing, and redeem the soonest-expiring credit without leaving codex-lb.
Type of change
fix:— bug fix (no behavior change beyond the bug)feat:— new user-facing feature or capabilityrefactor:— internal refactor (no behavior change, no API change)docs:— documentation onlychore:/ci:/build:— tooling, CI, packagingtest:— test-only change!after the type, e.g.feat!:or includeBREAKING CHANGE:footer)Linked issue: None specified.
OpenSpec
shape, SSE framing, OAuth flow) and preserves upstream-equivalent behavior
Change directory:
openspec/changes/add-rate-limit-reset-credits/Changes
/wham/rate-limit-reset-credits, plus a dashboard consume endpoint that serializes per-account redemption and invalidates stale snapshots.available_reset_creditsandreset_credit_nearest_expires_at, and preserve account status on upstream reset-credit polling failures.Reset (N)actions, expiry countdowns, and a confirmation dialog across the Accounts page, dashboard table/grid views, and the Accounts nav tab.Most reset credits.Test plan